Skip to content

feat(runtime): stream Suspense replacements through Flight - #145

Merged
ScriptedAlchemy merged 1 commit into
mainfrom
wave3/96-streaming
Sep 1, 2026
Merged

feat(runtime): stream Suspense replacements through Flight#145
ScriptedAlchemy merged 1 commit into
mainfrom
wave3/96-streaming

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

  • replace buffered-then-decode Flight with incremental decoding that commits Agent Document snapshots as Suspense boundaries resolve
  • add dispatcher.stream() for shell | progress | replace | error | complete events with invocation-local boundary IDs, bounded reconciler (depth, nodes, bytes, event rate, elapsed time), real backpressure, and AbortSignal cancellation
  • keep dispatcher.dispatch() as the default final-only public API so feat(runtime): dispatch final Agent Documents through Flight #144 consumers (generated entries and renderRoute helpers) stay compatible

Test plan

  • pnpm --filter @agent-bundle/runtime test (88 passed, 1 durable-only skipped)
  • pnpm --filter @agent-bundle/runtime typecheck
  • pnpm exec rslint packages/rsc-runtime/src packages/rsc-runtime/tests
  • examples/rsc-agent-runtime rsc-hook.integration.test.ts + host-artifacts.test.ts (12 passed)
  • pnpm eval:spot (1 passed)

Delivers stage 3 of #96 under #107 revision 2.

Decode Flight incrementally into bounded shell/progress/replace/error/complete
events with invocation-local boundary IDs, while keeping dispatch() final-only.
@ScriptedAlchemy
ScriptedAlchemy merged commit 33f8651 into main Sep 1, 2026
9 checks passed
@changeset-bot

changeset-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 339155b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@agent-bundle/runtime Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ScriptedAlchemy
ScriptedAlchemy deleted the wave3/96-streaming branch September 1, 2026 07:32
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T07:36:53.207863Z 339155b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 339155b005

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/rsc-runtime/src/reconciler.ts
Comment thread packages/rsc-runtime/src/reconciler.ts
Comment thread packages/rsc-runtime/src/reconciler.ts
Comment thread packages/rsc-runtime/src/reconciler.ts
Comment thread packages/rsc-runtime/src/dispatcher.ts
ScriptedAlchemy added a commit that referenced this pull request Sep 1, 2026
… 3.5 stage 2)

Rewrite the #145 Flight decode and bound-event pipeline on Effect Streams and fibers while keeping dispatch() and stream() byte-compatible. Refs #152.
ScriptedAlchemy added a commit that referenced this pull request Sep 1, 2026
… 3.5 stage 2) (#156)

* refactor(runtime): Effect-native dispatcher and stream pipeline (wave 3.5 stage 2)

Rewrite the #145 Flight decode and bound-event pipeline on Effect Streams and fibers while keeping dispatch() and stream() byte-compatible. Refs #152.

* fix(build): emit runtime types before agent-bundle declaration emit

agent-bundle's test helpers import @agent-bundle/runtime; CI was typechecking that package before runtime dist existed, which is why main's post-#154 Verify jobs fail in ~30s.

* docs(runtime): record the verified locked-stream teardown mechanism in comments

The maxEvents hang was not a blocking-interrupt deadlock: the acquireRelease
finalizer called cancel() on the Flight readable while the Flight client held
its reader, the locked-stream rejection became an Effect.promise defect during
scope close, and the event stream's exit never surfaced. Document that at the
scopedAbortSignal fix site and correct the boundary cancel() comment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant